<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <div v-for="(row, index) in list" :key="row.key">
        {{ row.value }}
        </div>
        <button @click="change">切换</button>
    </div>

    <script src="https://unpkg.com/vue@next"></script>
    <script>
        const vm = Vue.createApp({
            data: function(){
                return {
                    list : []
                }
            },
            methods: {
                change: function(){
                    this.list = [
                    
                        { key: 1, value: 1 },
                        { key: 4, value: 4 },
                        { key: 2, value: 22 },
                        { key: 3, value: 3 },
                        { key: 6, value: 6 },
                        { key: 7, value: 7 },
                        { key: 5, value: 55 }
                    ]
                }
            },
            mounted(){
                console.log(this.list )
                this.list = [
                    { key: 1, value: 1 },
                    { key: 2, value: 2 },
                    { key: 3, value: 3 },
                    { key: 4, value: 4 },
                    { key: 5, value: 5 }
                ]
            }
        })
        vm.mount('#app')
    </script>
</body>
</html>